<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/10/29
  Time: 16:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <style>
        body{
            font-family: 宋体;
            margin: 0;
        }
        .header-top{
            width: 100%;
            height: 80px;
        }
        .header-top-logo{
            width: 50%;
            text-align: center;
        }
        .header-top-text{
            width: 30%;
            text-align: right;
            font-size: 13px;
            color: #848484;
        }
        .header-top a{
            color: #848484;
            text-decoration: none;
        }
    </style>
</head>
<body>
<table class="header-top"  >
    <tr>
        <td rowspan="2" class="header-top-logo">
            <a href="${pageContext.request.contextPath}/jspPage/homePage.jsp">
                <img  src="${pageContext.request.contextPath}/img/logo.png"  alt="蜗牛图书商城"/>
            </a>
        </td>
    <c:if test="${not empty user}">
            <td class="header-top-text">
                <a href="${pageContext.request.contextPath}/personal/index">个人中心</a>|
                <a href="#">我的订单</a>
            </td>
    </c:if>
        <c:if test="${empty user}">
<%--当user对象的信息未登录时占位隐藏用的--%>
            <td class="header-top-text">
                <a href="#" style="display:none">个人中心|</a>
                <a href="#" style="display:none">我的订单</a>
            </td>
        </c:if>
            <td colspan="2"></td>
    </tr>
    <tr>
        <%--        <c:if test="${ username}" scope="session">--%>
        <c:if test="${not empty user}">
            <td class="header-top-text">
                你好！${user.username}[<a href="${pageContext.request.contextPath}/user/quit" >安全退出</a>]
            </td>
        </c:if>
        <%--        </c:if>--%>
        <c:if test="${empty user}">
            <td class="header-top-text">
                <a href="${pageContext.request.contextPath}/jspPage/login.jsp">登录</a>[<a href="${pageContext.request.contextPath}/jspPage/register.jsp">注册</a>]
            </td>
        </c:if>
    </tr>
</table>
</body>
</html>
